var testEditor;

$(function () {
    testEditor = editormd("editor", {
        width: "100%",
        height: "100%",
        syncScrolling: "single",
        path: "/resources/plugins/editor/lib/"
    });
    $('.side ul li').click(function () {
        $('.side ul li').removeClass('active');
        $(this).addClass('active');
    });
    $(document).on('click','.middle ul li',function(){
        $('.middle ul li').removeClass('active');
        $(this).addClass('active');
        $('#editor').show();
        $('#editor textarea').eq(0).html('#zheshiyige');

    });

    $('.cancel').click(function () {
        $('.create').toggle('hidden')
    });
    $('.middle .add').click(function () {
        if ($(this).data('category') == '') {
            alert('请先选择文集');
        } else {
            $('.article').append("<li>未命名文章</li>")
        }
    });
});

function formValidate() {
    if ($.trim($('input[name="category"]').val()) == "") {
        alert('名称不能为空');
        return false;
    }
    return true;

}